package org.chnxi.study.design.factory.abstractfactory;

/**
 * 抽象工厂测试
 */
public class AbstractFactoryTest {

    public static void main(String[] args) {
        System.out.println(">>>>>>>>>>小米<<<<<<<<<<");
        XiaomiFactory xiaomiFactory = new XiaomiFactory();
        IPhoneProduct iPhoneProduct = xiaomiFactory.phoneProduct();
        iPhoneProduct.start();
        iPhoneProduct.call();
        iPhoneProduct.sendSMS();
        iPhoneProduct.shutdown();
        IWIFIProduct iwifiProduct = xiaomiFactory.wifiProduct();
        iwifiProduct.start();
        iwifiProduct.setting();
        iwifiProduct.openWifi();
        iwifiProduct.shutdown();

        System.out.println(">>>>>>>>>>华为<<<<<<<<<<");
        HuaweiFactory huaweiFactory = new HuaweiFactory();
        iPhoneProduct = huaweiFactory.phoneProduct();
        iPhoneProduct.start();
        iPhoneProduct.call();
        iPhoneProduct.sendSMS();
        iPhoneProduct.shutdown();
        iwifiProduct = huaweiFactory.wifiProduct();
        iwifiProduct.start();
        iwifiProduct.setting();
        iwifiProduct.openWifi();
        iwifiProduct.shutdown();

    }

}
